package com.profound.notes;

import com.profound.notes.mvvm.ViewModelStore;
import com.profound.notes.mvvm.ViewModelStoreOwner;
import ohos.aafwk.ability.AbilitySlice;

/**
 * @author zjwujlei
 * @date 2021/4/24
 * @email zjwujlei@sina.com
 * @description
 */
public class ViewModelSlice extends AbilitySlice implements ViewModelStoreOwner {
    private ViewModelStore viewModelStore = new ViewModelStore();

    @Override
    public ViewModelStore getViewModelStore(){
        if(getAbility() == null){
            throw new RuntimeException("you slice do not attach an ability");
        }
        return viewModelStore;

    }

}
